<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>jsEvent对象测试之XY轴</title>
    <style>
        *{padding: 0;margin: 0;}
        .container{
            width: 200px;height: 100px;
            border: 1px solid #c00;
        }
        input[type="button"]{
            margin: 50px;
            border: none;
            width: 100px;height: 50px;background: green;
        }
    </style>
</head>
<body>
<span style="white-space:pre">123	</span>
<div id="div" class="container"></div>
<span style="white-space:pre">456	</span><!--<div id="div1" class="container"></div>
<span style="white-space:pre">	</span><input type="button" value="test" οnclick="test();">-->
<script>
    document.onmousemove = function (ev) {
        var e = ev || window.event;
        var div = document.getElementById('div');
        div.innerHTML = "clientX: "+e.clientX + ",clientY:"+ e.clientY +
            "</br> screenX:"+ e.screenX+",screenY:" + e.screenY;
    }

    /*  function test(ev) {
          var e = ev || window.event;
          var div1 = document.getElementById('div1');
          div1.innerHTML = "offsetX:"+ e.offsetX +",offsetY : "+ e.offsetY;
      }*/
</script>
</body>
</html>